package com.kob.backend.service.impl.sell;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.kob.backend.mapper.SellMapper;
import com.kob.backend.pojo.sell;
import com.kob.backend.service.sell.GetShopidByProductid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;
@Service
public class GetShopidServiceImpl implements GetShopidByProductid {
    @Autowired
    private SellMapper sellMapper;
    @Override
    public Map<String, String> getshopid(Integer productid) {
        QueryWrapper queryWrapper=new QueryWrapper<sell>();
        queryWrapper.eq("productid",productid);
        sell this_sell=sellMapper.selectOne(queryWrapper);
        Map<String, String>map=new HashMap<>();
        map.put("error_message","success");
        Integer shopid=this_sell.getShopid();
        map.put("shopid", String.valueOf(shopid));
        return map;
    }
}
